﻿// -------------------------------------------------------------------------
//    @FileName         :    NFActivityEightPart.h
//    @Author           :    gaoyi
//    @Date             :    24-8-30
//    @Email            :    445267987@qq.com
//    @Module           :    NFActivityEightPart
//
// -------------------------------------------------------------------------

#pragma once

#include <NFLogicCommon/NFLogicShmTypeDefines.h>
#include "NFPart.h"
#include "proto_common_activity.nanopb.h"

/**
 * @brief 嘉年华活动
 */
class NFActivityEightPart : public NF_OBJECT_TEMPLATE_MACRO(NFActivityEightPart, EOT_LOGIC_PART_MIN_ID + PART_ACTIVITYEIGHT, NFPart)
public:
    NFActivityEightPart();

    ~NFActivityEightPart() override;

    int CreateInit();
    int ResumeInit();

public:
    //******************part调用接口******************
    /**
     * @brief 所有部件初始化完成
     * @return
     */
    int OnInit() override
    {
        return 0;
    }

public:
    /**
     * @brief 从数据库中加载数据
     * @param data
     * @return
     */
    int LoadFromDB(const proto_ff::tbRoleDetail* pDBData) override;

    /**
     * @brief 从配置中初始化数据
     * @return
     */
    int InitConfig(proto_ff::tbRoleDetail* pDbData, const RoleOne& stRoleOne) override;

    /**
     * @brief 存储DB部件入口
     * @param proto
     * @return
     */
    int SaveDB(proto_ff::tbRoleDetail* pDBData) override;

    ////////////////////////////////// 每日零点 每周一零点 刷新接口 ///////////////////////////////////
    /**
     * @brief 每日零点 刷新接口
     * @return
     */
    int DayTick() override;
public:
    bool IsInActivityTime();
public:
    int MakePlayerDataCS(proto_ff::Proto_CSGetRoleRsp* pCSGetRoleRsp) override;
    int MakeCityPlayerData(proto_ff::CityRoleInfo* pGCCityRoleInfo) override;
public:
    ActivityEightData& GetData() { return m_stData; }
    const ActivityEightData& GetData() const { return m_stData; }
private:
    ActivityEightData m_stData;
};
